<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<html:html>
<head>
<html:base />
<title><bean:message key="Application.Name"/></title>
<link href="css/formas.css" rel="stylesheet" type="text/css">
<link href="css/calendar.css" rel="stylesheet" type="text/css">
<style type="text/css">
#div_cal {
	background-color:#FF9933;
	position:absolute;
}
</style>
<script LANGUAGE="JavaScript" type="text/javascript" src="js/AnchorPosition.js"></script>
<script LANGUAGE="JavaScript" type="text/javascript" src="js/PopupWindow.js"></script>
<script LANGUAGE="JavaScript" type="text/javascript" src="js/date.js"></script>
<script LANGUAGE="JavaScript" type="text/javascript" src="js/CalendarPopup.js"></script>
<script language="javascript" type="text/javascript" src="js/util.js"></script>
<script language="javascript" type="text/javascript">
	function fnc_validarForma(forma){
		var bol_retVal = true;
		var str_errores = "";
		
		if( Trim(forma.conceptosPrevios.value) == "" ){
			str_errores += " - <bean:message key="StudyPlan.content.conceptRelation.Prev"/> <bean:message key='errors.required'/>\n";
		}
		if( Trim(forma.conceptosPosteriores.value) == "" ){
			str_errores += " - <bean:message key="StudyPlan.content.conceptRelation.Post"/> <bean:message key='errors.required'/>\n";
		}
		
		if( str_errores != "" ){
			bol_retVal = false;
			alert( " <bean:message key='Application.Error(s)'/> : \n" + str_errores );
		}
		return bol_retVal;
	}
	function fnc_closeReview(){
		if( '<bean:write name="ses_usuario" property="per_planes"/>' == '1'   ){
			var forma = document.forms[0];
			forma.conceptosPrevios.disabled = true;
			forma.conceptosPosteriores.disabled = true;
			forma.btn_aceptar.disabled = true;
		}
	}
</script>
</head>
<body onload="fnc_closeReview();">
	<div id="div_cal"></div>
 	<table cellpadding="0" cellspacing="0" class="formas">
		<tr>
	    	<td>
			  	<table cellpadding="0" cellspacing="0" class="barraNavegacion">
					<tr>
			        	<td><html:link action="/academy_welcome?action=selectAcademy" styleClass="barraNavegacion"><img src="images/icn_liga.gif" border="0"><bean:message key="AcademyWelcome.Init"/></html:link>
			        		<html:link action="/academy_list" styleClass="barraNavegacion"><img src="images/icn_liga.gif" border="0"><bean:message key="Menu.AcademyHeader"/></html:link>
			        		<html:link action="/subject_list" styleClass="barraNavegacion" name="academia" property="map_id"><img src="images/icn_liga.gif" border="0"><bean:message key="StudyPlan.subjects"/></html:link>
			        		<html:link action="/contents_list" styleClass="barraNavegacion" name="materia" property="map_id"><img src="images/icn_liga.gif" border="0"><bean:message key="StudyPlan.subjects.contents"/></html:link>
		              	</td>
	    			</tr>
			    </table>
			  	<table cellpadding="0" cellspacing="0" class="titulo">
	                <tr>
	                	<td class="iconos_imgs"><a href="mailto:<bean:message key="Application.mailto"/>"><img src="images/icn_correo.gif" width="18" height="18" border="0"></a></td>
	                	<td class="txt_titulo"><bean:message key="StudyPlan.content.conceptRelationTile"/></td>
		            </tr>
	            </table>
	            <html:form action="/save_conceptRelation" onsubmit="return fnc_validarForma(this);">
	            	<input type="hidden" name="subject_id" value="<bean:write name="materia" property="codigo"/>"/>
	            	<input type="hidden" name="academy_id" value="<bean:write name="academia" property="codigo"/>"/>
					<table cellpadding="0" cellspacing="2" class="info_formas">
						<tr> 
							<td>&nbsp;</td>
						</tr>
						<tr> 
							<td class="formas-encabezado"><bean:message key="StudyPlan.subject.subjectData"/></td>
						</tr>
						<tr> 
							<td>
								<table cellpadding="0" cellspacing="2" class="info_titulo">
									<tr> 
										<td class=""><strong><bean:message key="StudyPlan.subject"/></strong></td>
										<td class=""><bean:write name="materia" property="codigo"/> - <bean:write name="materia" property="nombre"/></td>
									</tr>
									<tr> 
										<td class=""><strong><bean:message key="AcademyWelcome.Academy"/></strong></td>
										<td class=""><bean:write name="academia" property="codigo"/> - <bean:write name="academia" property="nombre"/></td>
									</tr>
								</table>
							</td>
						</tr>
						<tr> 
							<td class="formas-encabezado"><bean:message key="StudyPlan.content.conceptRelation.Prev"/></td>
						</tr>
						<tr> 
							<td colspan="3" align="center">
								<table cellpadding="0" cellspacing="2" class="info_titulo">
									<tr> 
										<td class="" align="center">
											<br/><html:textarea property="conceptosPrevios" cols="75" rows="10"></html:textarea>
										</td>
									</tr>
								</table>
							</td>
						</tr>
						<tr> 
							<td class="formas-encabezado"><bean:message key="StudyPlan.content.conceptRelation.Post"/></td>
						</tr>
						<tr> 
							<td colspan="3" align="center">
								<table cellpadding="0" cellspacing="2" class="info_titulo">
									<tr> 
										<td class="" align="center">
											<br/><html:textarea property="conceptosPosteriores" cols="75" rows="10"></html:textarea>
										</td>
									</tr>
								</table>
							</td>
						</tr>
						<tr> 
							<td colspan="3" align="center">
								<div align="center">
									<html:submit property="btn_aceptar"><bean:message key="Application.Accept" /></html:submit>
									<input type="button" onclick="location.href='<html:rewrite action="/contents_list" name="materia" property="map_id"/>';" value="<bean:message key='Application.Cancel'/>"/>
								</div>
							</td>
						</tr>
						<tr> 
							<td colspan="3"><div align="center"></div></td>
						</tr>
					</table>
				</html:form>
			</td>
		</tr>
  </table>  
</body>
</html:html>